<%@ Page Language="c#" CodeBehind="RolesList.aspx.cs" AutoEventWireup="True" Inherits="PPAP.Web.BasicManage.RolesList" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
    <title>RolesList</title>
    <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
    <meta name="CODE_LANGUAGE" content="C#">
    <meta name="vs_defaultClientScript" content="JavaScript">
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    <script language="javascript">

        function add() {
            url = "RolesSave.aspx";
            PopUpWindow(url, 300, 200, 430, 220);
        }
        function edit(id) {
            url = "RolesSave.aspx?RolesID=" + id;
            PopUpWindow(url, 300, 200, 430, 220);
        }

        function rightEdit(id) {
            url = "RolesSelectRight.aspx?RolesID=" + id;
            PopUpWindow(url, 300, 80, 430, 500);
        }
        function userEdit(id) {
            url = "RolesSelectUser.aspx?RolesID=" + id;
            PopUpWindow(url, 300, 80, 430, 500);
        }
    </script>
</head>
<font size='-1' color='gray'>Current position:Admin>>Role Manager</font>
<body style="font-family: Arial, Helvetica, sans-serif;" ms_positioning="FlowLayout">
    <form id="Form1" method="post" runat="server">
    <div align="center">
        <div align="right" id="divAdd" runat="server">
            <input type="button" value="Add" onclick="add()" class="button" /></div>
        <asp:DataGrid ID="dgList" Width="100%" runat="server" AutoGenerateColumns="False"
            OnLoad="dgLoad">
            <Columns>
                <asp:BoundColumn DataField="RolesID" HeaderText="ID" Visible="False"></asp:BoundColumn>
                <asp:TemplateColumn HeaderText="No.">
                    <ItemStyle Width="5%" HorizontalAlign="Left"></ItemStyle>
                    <ItemTemplate>
                        <asp:Label ID="lb" runat="server" Text='<%#Eval("rownum") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:BoundColumn DataField="RoleName" HeaderText="Role Name" HeaderStyle-HorizontalAlign="Left">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="Des" HeaderText="Describe" HeaderStyle-HorizontalAlign="Left">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:HyperLinkColumn Text="Role Information" Visible="false" DataNavigateUrlField="RolesID" DataNavigateUrlFormatString="javascript:edit({0})"
                    HeaderText="Operate" HeaderStyle-HorizontalAlign="Left">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:HyperLinkColumn>
                <asp:HyperLinkColumn Text="Role permission" Visible="false" DataNavigateUrlField="RolesID" DataNavigateUrlFormatString="javascript:rightEdit({0})"
                    HeaderText="Operate" HeaderStyle-HorizontalAlign="Left">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:HyperLinkColumn>
                <asp:HyperLinkColumn Text="Role Users" Visible="false" DataNavigateUrlField="RolesID" DataNavigateUrlFormatString="javascript:userEdit({0})"
                    HeaderText="Operate" HeaderStyle-HorizontalAlign="Left">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:HyperLinkColumn>
                <asp:TemplateColumn HeaderText="Role Information" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <img src="../Images/newimg/write.png" title="Role Information" onclick="<%#"javascript:edit("+Eval("RolesID")+")" %>" />
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="Role permission" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <img src="../Images/newimg/write.png" title="Role permission" onclick="<%#"javascript:rightEdit("+Eval("RolesID")+")" %>" />
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="Role Users" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <img src="../Images/newimg/write.png" title="Role Users" onclick="<%#"javascript:userEdit("+Eval("RolesID")+")" %>" />
                    </ItemTemplate>
                </asp:TemplateColumn>
            </Columns>
        </asp:DataGrid>
    </div>
    </form>
</body>
</html>
